/***************************************************************************
 *   Copyright (C) 2009 by Marian Skvarek   *
 *   skvarek.marian@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A TrackICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef EASYSCORE_CORECSCORE_H
#define EASYSCORE_CORECSCORE_H

#include "CFraction.h"
#include "CTempo.h"
#include "CScoreSettings.h"

#include <QLinkedList>
#include <QString>

using namespace easyscore::utils;
using namespace easyscore::core::utils;

namespace easyscore
{
	class CEasyScoreApp;

	namespace core
	{

		class CPart;
                class CTrack;
                class CBar;
		class CScoreView;
		
		namespace utils
		{
			class CScoreSettings;
		}

		/** 
			\brief Core class representing score document
			@author Marian Skvarek <skvarek.marian@gmail.com>
		*/
		class CScore
		{

//Members
			private:
				bool mInitialized;
				QLinkedList<CPart *> mParts;
				QString mAuthorName;
				QString mSongname;
				CFraction mTime;
				CTempo mTempo;
 				bool mModified;
				CEasyScoreApp *mParentApp;
				
				CScoreView *mView;

//Accessors
			public:
				QLinkedList< CPart * > &getParts()  { return mParts; }
                                void setAuthorName(QString value) { mAuthorName = value; }
				QString getAuthorName() const { return mAuthorName; }
                                void setSongName(QString value) { mSongname = value; }
				QString getSongname() const { return mSongname; }
                                void setTime(CFraction value) { mTime = value; }
				CFraction &getTime() { return mTime; }
                                void setTempo(CTempo value) { mTempo = value; }
				CTempo &getTempo() { return mTempo; }
				bool getModified() const { return mModified; }
				void setModified(bool value) { mModified = value; }
				CEasyScoreApp *getParentApp() { return mParentApp; }
				void setParentApp(CEasyScoreApp *value) { mParentApp = value; }
				
				CScoreView *getView() { return mView; }
					
//Constructors, Initialization & Destructors
			public:
				CScore(CEasyScoreApp *parentApp = 0);
				void initialize ( CScoreSettings *settings );
				
				void clear();
				~CScore();
			
//Public methods
			public:
                                void addPart(CPart *part);
                                QLinkedList<CTrack *> getTracks();
                                QLinkedList<CBar *> getBars();

				bool hasView() { return getView() != 0; }
				void createView();
				void destroyView();
	

//Protected methods
			protected:



		}; // class CScore
	} //namespace core
} //namespace easyscore

#endif
